package com.example.springbootdemo.mapper;

import com.example.springbootdemo.entity.User;
import org.apache.ibatis.annotations.*;

import javax.annotation.Resource;
import java.util.List;

public interface UserMapper {
    @Select("select * from user")
    List<User> userList();

    @Delete("delete from user where id=#{id}")
    Integer delete(Integer id);

    @Insert("insert into user(id,name,password,number) value(null,#{name},#{password},#{number})")
    Integer insert(User user);

    @Update("update user set name=#{name},password=#{password},number=#{number} where id=#{id}")
    Integer update(User Uuser);

    @Select("select * from user where id=#{id}")
    User getUser(Integer id);
}
